﻿using System;
using Unity.Mathematics;
using UnityEngine;

namespace Mars.GpuInstance
{
    public struct SimpleBound : IEquatable<SimpleBound>
    {
        public float2 minPos;
        public float2 maxPos;

        public SimpleBound(Vector2 minPos, Vector2 maxPos)
        {
            this.minPos = minPos;
            this.maxPos = maxPos;
        }
        
        public SimpleBound(float2 minPos, float2 maxPos)
        {
            this.minPos = minPos;
            this.maxPos = maxPos;
        }

        public SimpleBound(float4 bound)
        {
            this.minPos = new float2(bound.x, bound.y);
            this.maxPos = new float2(bound.z, bound.w);
        }

        public bool Equals(SimpleBound other)
        {
            if (minPos.Equals(other.minPos) && maxPos.Equals(other.maxPos))
            {
                return true;
            }
            return false;
        }
    }

    public struct RefSimpleBound
    {
        public int refCount;
        public SimpleBound bound;
    }
}
